package com.wwj.auction.order.client;

import com.wwj.auction.common.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;

@FeignClient("service-login")
public interface ServiceLoginClient {

    /**
     * 生成买家的购买记录
     *
     * @param userId
     * @param shopId
     * @param orderNo
     * @return
     */
    @GetMapping("/login/buyRecord/create/{userId}/{shopId}/{orderNo}")
    R create(
            @PathVariable("userId") Integer userId,
            @PathVariable("shopId") Integer shopId,
            @PathVariable("orderNo") String orderNo);

    @GetMapping("/login/offerRecord/first/{shopId}")
    R first(@PathVariable("shopId") Integer shopId);

    @GetMapping("/login/userAccount/subtract/amount/{userId}/{shopPrice}/{earnestMoney}/{shopFreight}")
    R subtractAmount(
            @PathVariable("userId") Integer userId,
            @PathVariable("shopPrice") BigDecimal shopPrice,
            @PathVariable("earnestMoney") BigDecimal earnestMoney,
            @PathVariable("shopFreight") BigDecimal shopFreight
    );
}
